package com.kgc.service.Impl;

import com.kgc.dao.mapper.CommentsMapper;
import com.kgc.entity.Comments;
import com.kgc.service.interf.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentsServiceImpl implements CommentsService {
    @Autowired
    private CommentsMapper commentsMapper;

    //查询所有评论
    @Override
    public List<Comments> selectAll(Comments comments) {
        return commentsMapper.selectAll(comments);
    }

    //新增评论
    @Override
    public int addComments(Comments comments) {
        return commentsMapper.addComments(comments);
    }

    //用户删除个人评论
    @Override
    public int delByUserid(Comments comments) {
        return commentsMapper.delByUserid(comments);
    }

    //管理员删除评论
    @Override
    public int delComments(Comments comments) {
        return commentsMapper.delComments(comments);
    }


}
